﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace MyClusterTool
{
    public partial class MyClusterToolPluginForm : Form
    {
        public MyClusterToolPluginForm()
        {
            InitializeComponent();
        }

        private string exeClusterFilePath = string.Empty;

        public string ExeClusterFilePath
        {
            get { return exeClusterFilePath; }            
        }

        private void button_ECFSet_Click(object sender, EventArgs e)
        {
            openFileDialog.Multiselect = false;
            openFileDialog.InitialDirectory = System.IO.Directory.GetCurrentDirectory();
            openFileDialog.FileName = string.Empty;
            openFileDialog.Filter = "Execute File (*.exe) |*.exe";

            if (openFileDialog.ShowDialog() == DialogResult.OK)
            {
                this.textBox_ECF.Text = openFileDialog.FileName;
                exeClusterFilePath = openFileDialog.FileName;
            }
        }

        private uint numOfCluster = 1;

        public uint NumOfCluster
        {
            get { return numOfCluster; }            
        }

        private void button_NOCSet_Click(object sender, EventArgs e)
        {
            try
            {
                numOfCluster = uint.Parse(this.textBox_NOC.Text);
                MessageBox.Show("Number of cluster set!");
            }
            catch
            {
                MessageBox.Show("Please enter an unsigned integer!");
            }
        }

        private void button_OK_Click(object sender, EventArgs e)
        {
            this.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.Close();
        }

        private void button_Cancel_Click(object sender, EventArgs e)
        {
            this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.Close();
        }
    }
}
